package cn.itcast.gateway.ratelimit;

import cn.itcast.gateway.mapper.KeyResolver;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

@Component
public class IpKeyResolver implements KeyResolver {
    @Override
    public Mono<String> resolve(ServerWebExchange exchange) {
        //获取请求URI;
        return Mono.just(exchange.getRequest().getURI().getPath());
    }
}
